<template>
    <div>
        <div>
            <van-nav-bar style="background: #d12d1a;" class="fh" @click-left="$router.back()" title="我的发布"
                left-text="返回" left-arrow />
        </div>
        <index :key="gx" :APIss="APIss" :uid="uid">
            <template v-slot:default="{ dx }">
                <xhdzj @sc="sc" :showxs="true" :dx="dx"></xhdzj>
            </template>
        </index>
    </div>
</template>

<script>
import { wdfb as APIss } from '@/api/fbjk'         //把接口传过去 uid也传过去  接口是一个函数 props 接受是一个函数
import index from '@/components/ggdage/index.vue'
import xhdzj from '@/components/ggdage/xhdzj.vue'
import { scfb } from '@/api/scfb'
import {Dialog} from 'vant'

export default {
    components: {
        index,
        xhdzj
    },
    data() {
        return {
            APIss,
            gx: 0
        }
    },
    computed: {
        uid() {
            return this.$store.state.mkhuser.uid
        }
    },
    methods: {
        sc(_id, uid) {
            Dialog.confirm({
                    message: '您确定要删除吗？',
                })
                    .then(() => {
                        // on confirm
                        scfb({
                _id,
                uid
            }).then(res => {
                console.log(res)
                if (res.code == 0) {
                    this.$toast(res.msg)
                    this.gx++

                }
            })
                    })
                    .catch(() => {
                        // on cancel
                    });


            
        }
    }
}
</script>


<style scoped>
.input:-internal-autofill-selected {
    background-color: none;
}

::v-deep .van-ellipsis {
    color: #FFB619;
}

::v-deep .van-nav-bar__text {
    color: #FFB619;
}

::v-deep .van-icon-arrow-left {
    color: #FFB619;
}

::v-deep .van-button--info {
    background: #d12d1a;
    border: 1px solid #d12d1a;
    color: #FFB619;
}

.fd {
    display: flex;
    justify-content: space-between;
}
</style>
